package com.lakeworks.common.core.page;

import lombok.Getter;
import lombok.Setter;

@Getter
public class PageParams {

    /**
     * 页码，默认1
     */
    private int pageNum = 1;

    /**
     * 一页显示条数，默认30
     */
    private int pageSize = 30;

    /**
     * 排序列（数据库字段名,默认id）
     */
    @Setter
    private String orderFiled = "id";

    /**
     * 是否asc （默认为true,false为desc）
     */
    @Setter
    private boolean asc = true;

    public void setPageNum(int pageNum) {
        if (pageNum <= 0)
            return;
        this.pageNum = pageNum;
    }

    public void setPageSize(int pageSize) {
        if (pageSize <= 0)
            return;
        this.pageSize = pageSize;
    }
}
